/**
 * 
 */
package main.builder;

/**
 * @author Hoan.NguyenTrong Jan 22, 2015
 * 
 */
public class Person {

    private String firstName; // required
    private String lastName; // required
    private int age; // optional
    private String phone; // optional
    private String address; // optional

    public Person() {
	super();
    }

    public static class PersonBuilder {

	private Person person;

	public PersonBuilder() {
	    this.person = new Person();
	}

	public PersonBuilder buildFirstName(String firstName) {
	    person.firstName = firstName;
	    return this;
	}
	
	public PersonBuilder buildLastName(String lastName) {
	    person.lastName = lastName;
	    return this;
	}

	public Person build() {
	    return person;
	}
    }

    public String getFirstName() {
	return firstName;
    }

    public String getLastName() {
	return lastName;
    }

    public int getAge() {
	return age;
    }

    public String getPhone() {
	return phone;
    }

    public String getAddress() {
	return address;
    }
}
